//index.js
//获取应用实例
const app = getApp()

var data = {
  count: '30'
}

// Register a Page.
Page({
  data: data,

  onLoad: function (options) {
    wx.request({
      url: app.globalData.serDomain + '/purchase/index',//连接服务器从表中查询出学生信息的接口
      data: {
        page: 0,
        //   condition: this.data.condition
      },
      header: {
        'content-type': 'application/json'
      },
      success: (res) => {
        this.setData({
          list: res.data,//将表中查询出来的信息传给list
        })
      }
    })
  },

  //跳转详情页
  chageToTest: function (event) {

    var id = event.currentTarget.dataset.id   //获取传递的值
    console.log(id);
    wx.navigateTo({

      url: '../purchaseDetail/purchaseDetail?id=' + id,
    })
  },





})

